package cn.kgc.service;

import cn.kgc.dao.BackendDao;
import cn.kgc.pojo.AppCategory;
import cn.kgc.pojo.AppVersion;
import cn.kgc.pojo.BackendAppInfo;
import cn.kgc.pojo.DataDictionary;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BackendServiceImpl implements BackendService{
    @Resource
    private BackendDao backendDao;


    @Override
    public List<DataDictionary> appFlatformList() {
        return backendDao.appFlatformList();
    }

    @Override
    public List<AppCategory> categoryLevel1List() {
        return backendDao.categoryLevel1List();
    }

    @Override
    public List<AppCategory> categoryLevel2List(Integer parentId) {
        return backendDao.categoryLevel2List(parentId);
    }

    @Override
    public Page<BackendAppInfo> selAppList(BackendAppInfo backendAppInfo) {
        return backendDao.selAppList(backendAppInfo);
    }

    @Override
    public BackendAppInfo selOneByIds(Integer id) {
        return backendDao.selOneByIds(id);
    }

    @Override
    public AppVersion selVersion(Integer id) {
        return backendDao.selVersion(id);
    }

    @Override
    public Boolean updAppStatus(Integer id, Integer status) {
        if (backendDao.updAppStatus(id,status)>0){
            return true;
        }
        return false;
    }
}
